inherited rstPays: TrstPays
  HelpContext = 1146
  ActiveControl = dteBDate
  Caption = #1056#1077#1077#1089#1090#1088' '#1086#1087#1077#1088#1072#1094#1080#1081
  OnActivate = FormActivate
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    inherited TfraAddress1: TfraAddress
      Top = 139
      Height = 170
      TabOrder = 1
      inherited SearchBox: TGroupBox
        Height = 170
        Constraints.MinHeight = 170
        inherited SubPanel: TPanel
          Height = 153
          inherited Label6: TLabel
            Top = 4
            Alignment = taRightJustify
          end
          inherited Label5: TLabel
            Left = 68
            Top = 195
            Alignment = taRightJustify
            Visible = False
          end
          inherited Label4: TLabel
            Top = 101
            Alignment = taRightJustify
          end
          inherited Label3: TLabel
            Top = 77
            Alignment = taRightJustify
          end
          inherited Label2: TLabel
            Top = 53
            Alignment = taRightJustify
          end
          inherited Label1: TLabel
            Top = 29
            Alignment = taRightJustify
          end
          inherited TownBox: TDBLookupComboboxEh
            Top = 26
            TabOrder = 1
          end
          inherited StreetBox: TDBLookupComboboxEh
            Top = 50
            TabOrder = 2
          end
          inherited NLSEdit: TDBEditEh
            Top = 2
          end
          inherited NameEdit: TDBEditEh
            Left = 100
            Top = 192
            TabStop = False
            Enabled = False
            TabOrder = 5
            Visible = False
          end
          inherited HouseBox: TDBLookupComboboxEh
            Top = 74
            TabOrder = 3
          end
          inherited FindBtn: TButton
            Left = 6
            Top = 122
            Caption = #1055#1086#1080#1089#1082
          end
          inherited ClearBtn: TButton
            Left = 85
            Top = 122
            OnClick = TfraAddress1ClearBtnClick
          end
          inherited AppartBox: TDBLookupComboboxEh
            Top = 98
            TabOrder = 4
          end
          inherited AddBtn: TButton
            Left = 164
            Top = 122
            Width = 91
            OnClick = TfraAddress1AddBtnClick
          end
        end
      end
      inherited QStreets: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QHouses: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QTowns: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QApparts: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
    end
    inherited GroupBox1: TGroupBox
      Height = 139
      TabOrder = 0
      object Label6: TLabel
        Left = 64
        Top = 20
        Width = 35
        Height = 13
        Alignment = taRightJustify
        Caption = #1044#1072#1090#1072' '#1089
      end
      object Label1: TLabel
        Left = 58
        Top = 44
        Width = 41
        Height = 13
        Alignment = taRightJustify
        Caption = #1044#1072#1090#1072' '#1087#1086
      end
      object Label2: TLabel
        Left = 29
        Top = 68
        Width = 70
        Height = 13
        Alignment = taRightJustify
        Caption = #1058#1080#1087' '#1086#1087#1077#1088#1072#1094#1080#1080
      end
      object Label3: TLabel
        Left = 34
        Top = 116
        Width = 65
        Height = 13
        Alignment = taRightJustify
        Caption = #1043#1088#1091#1087#1087#1072' '#1091#1089#1083#1091#1075
      end
      object Label4: TLabel
        Left = 55
        Top = 92
        Width = 44
        Height = 13
        Alignment = taRightJustify
        Caption = #1055#1088#1080#1079#1085#1072#1082
      end
      object dteBDate: TDBDateTimeEditEh
        Left = 104
        Top = 16
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 0
        Visible = True
      end
      object dteEDate: TDBDateTimeEditEh
        Left = 104
        Top = 40
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 1
        Visible = True
      end
      object cbPType: TDBLookupComboboxEh
        Left = 104
        Top = 64
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = '--'
        DropDownBox.SpecRow.Value = '0'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'CODE'
        ListField = 'PAY_NAME'
        ListSource = dscTypes
        TabOrder = 2
        Visible = True
      end
      object cbTrait: TDBLookupComboboxEh
        Left = 104
        Top = 88
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = '--'
        DropDownBox.SpecRow.Value = '0'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dscTraits
        TabOrder = 3
        Visible = True
      end
      object cbGroup: TDBLookupComboboxEh
        Left = 104
        Top = 112
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = '--'
        DropDownBox.SpecRow.Value = '0'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dscGroups
        TabOrder = 4
        Visible = True
      end
    end
    inherited TfraSubstanceInfo1: TfraSubstanceInfo
      Top = 309
      Height = 260
      inherited TopPanel: TPanel
        Height = 0
      end
      inherited BottomPanel: TPanel
        Top = 260
        Height = 0
      end
      inherited PageControl: TPageControl
        Top = 0
        Height = 260
        inherited TSInfo: TTabSheet
          inherited InfoGrid: TDBGridEh
            Height = 229
            OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
            UseMultiTitle = True
            VTitleMargin = 5
          end
        end
      end
      inherited QSubstanceInfo: TpFIBDataSet
        SelectSQL.Strings = (
          'SELECT'
          '    RFIELD_NAME as name,'
          '    RFIELD_VALUE as val'
          'FROM'
          '  PROC_PAY_GET_PROP_LIST(:ID)')
        Transaction = trRefer
        UpdateTransaction = trRefer
        DataSource = dscRefer
      end
    end
  end
  inherited Panel2: TPanel
    inherited GroupBox2: TGroupBox
      Caption = ' '#1051#1100#1075#1086#1090#1099' '#1087#1086' '#1086#1087#1077#1088#1072#1094#1080#1080' '
      inherited DetailGrid: TDBGridEh
        DataSource = dscDetail
        OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
        UseMultiTitle = True
        VTitleMargin = 5
        Columns = <
          item
            EditButtons = <>
            FieldName = 'NAME'
            Footers = <>
            Width = 155
          end
          item
            EditButtons = <>
            FieldName = 'EXEMPT'
            Footers = <>
            Width = 174
          end
          item
            EditButtons = <>
            FieldName = 'GIVENSUMMA'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'GIVENCOUNT'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'EXVAL'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'GIVENDATE'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'PERIOD_END'
            Footers = <>
            Visible = False
          end
          item
            EditButtons = <>
            FieldName = 'CNAME'
            Footers = <>
            Width = 724
          end>
      end
    end
    inherited Panel3: TPanel
      inherited dbgRefer: TDBGridEh
        FooterRowCount = 1
        SumList.Active = True
        Columns = <
          item
            EditButtons = <>
            FieldName = 'RID'
            Footers = <>
            Width = 40
          end
          item
            EditButtons = <>
            FieldName = 'RPNAME'
            Footers = <>
            Width = 126
          end
          item
            EditButtons = <>
            FieldName = 'RSUMMA'
            Footer.ValueType = fvtSum
            Footers = <>
            Width = 51
          end
          item
            EditButtons = <>
            FieldName = 'RDOCNO'
            Footers = <>
            Width = 70
          end
          item
            EditButtons = <>
            FieldName = 'RDATE'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RSERVICE_NAME'
            Footers = <>
            Width = 126
          end
          item
            EditButtons = <>
            FieldName = 'RDOGOVOR_ID'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RADDRESS'
            Footers = <>
            Width = 164
          end
          item
            EditButtons = <>
            FieldName = 'RNOTE'
            Footers = <>
            Width = 146
          end
          item
            EditButtons = <>
            FieldName = 'RREESTR'
            Footers = <>
          end>
      end
    end
  end
  inherited shblActionList: TActionList
    inherited aInsert: TAction
      Visible = False
    end
    inherited aPost: TAction
      Visible = False
    end
    inherited aRollback: TAction
      Visible = False
    end
    inherited aPrint: TAction
      Visible = False
    end
  end
  inherited dsRefer: TpFIBDataSet
    SelectSQL.Strings = (
      'select RID,'
      'RPNAME,'
      'RREESTR,'
      'RSUMMA,'
      'RDOCNO,'
      'RDATE,'
      'RSERVICE_NAME,'
      'RDOGOVOR_ID,'
      'RADDRESS,'
      'RNOTE,'
      'rid as id'
      'from proc_v_pays'
      '(:PBDATE,'
      ':PEDATE,'
      ':PNLS,'
      ':PTOWN_ID,'
      ':PSTREET_ID,'
      ':PBUILDING_ID,'
      ':PAPPARTS,'
      ':PLETTER,'
      ':PABONENT_ID,'
      ':PTYPE,'
      ':PGROUP,'
      ':PTRAIT,'
      ':ADD_PARAM'
      ')')
    AutoUpdateOptions.UpdateTableName = 'PROC_V_PAYS'
    AutoUpdateOptions.KeyFields = 'RID'
    Database = MAINDM.pMainDatabase
    UpdateTransaction = MAINDM.pMainTransaction
    object dsReferRID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'RID'
    end
    object dsReferRPNAME: TFIBStringField
      DisplayLabel = #1058#1080#1087' '#1086#1087#1077#1088#1072#1094#1080#1080
      DisplayWidth = 10
      FieldName = 'RPNAME'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferRSUMMA: TFIBBCDField
      DisplayLabel = #1057#1091#1084#1084#1072
      FieldName = 'RSUMMA'
      Size = 2
      RoundByScale = True
    end
    object dsReferRDOCNO: TFIBStringField
      DisplayLabel = #8470#1076#1086#1082#1091#1084#1077#1085#1090#1072
      FieldName = 'RDOCNO'
      Size = 30
      EmptyStrToNull = True
    end
    object dsReferRDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072
      FieldName = 'RDATE'
    end
    object dsReferRSERVICE_NAME: TFIBStringField
      DisplayLabel = #1059#1089#1083#1091#1075#1072
      DisplayWidth = 15
      FieldName = 'RSERVICE_NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferRDOGOVOR_ID: TFIBIntegerField
      DisplayLabel = #1048#1044' '#1076#1086#1075#1086#1074#1086#1088#1072
      FieldName = 'RDOGOVOR_ID'
    end
    object dsReferRADDRESS: TFIBStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 25
      FieldName = 'RADDRESS'
      Size = 255
      EmptyStrToNull = True
    end
    object dsReferRNOTE: TFIBStringField
      DisplayLabel = #1055#1088#1080#1084#1077#1095#1072#1085#1080#1103
      DisplayWidth = 15
      FieldName = 'RNOTE'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsReferRREESTR: TFIBStringField
      DisplayLabel = #8470' '#1088#1077#1077#1089#1090#1088#1072
      DisplayWidth = 12
      FieldName = 'RREESTR'
      EmptyStrToNull = True
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'rstPays'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.Left'
      '<P>.PixelsPerInch'
      '<P>.Top'
      '<P>.Width'
      '<P>.WindowState'
      'Panel2.GroupBox2.<P>.Height'
      'Panel2.GroupBox2.DetailGrid.<P>.Columns.ColumnsIndex'
      'Panel2.GroupBox2.DetailGrid.<P>.Columns.<ForAllItems>.Width'
      'Panel2.Panel3.dbgRefer.<P>.Columns.ColumnsIndex'
      'Panel2.Panel3.dbgRefer.<P>.Columns.<ForAllItems>.Width')
  end
  object dsDetail: TpFIBDataSet [11]
    SelectSQL.Strings = (
      'select c.name, et.name exempt, ge.givensumma, ge.givencount,'
      '       ge.chargesumma as exval, ge.givendate, ge.period_end,'
      '       (select cn.name from clients cn'
      '          where cn.id = ge.client_id) as cname'
      
        '  from given_exempts ge, clientexempts ce, exempttypes et, clien' +
        'ts c'
      '  where et.id = ce.exempttypes_id'
      '    and ce.id = ge.clientexempt_id'
      '    and c.id = ce.client_id'
      '    and ge.pay_id = :id')
    Transaction = trRefer
    Database = MAINDM.pMainDatabase
    DataSource = dscRefer
    Left = 76
    Top = 508
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsDetailNAME: TFIBStringField
      DisplayLabel = #1060#1048#1054
      FieldName = 'NAME'
      Size = 92
      EmptyStrToNull = True
    end
    object dsDetailEXEMPT: TFIBStringField
      DisplayLabel = #1051#1100#1075#1086#1090#1072
      FieldName = 'EXEMPT'
      Size = 120
      EmptyStrToNull = True
    end
    object dsDetailGIVENSUMMA: TFIBBCDField
      DisplayLabel = #1057#1091#1084#1084#1072
      FieldName = 'GIVENSUMMA'
      Size = 2
      RoundByScale = True
    end
    object dsDetailGIVENCOUNT: TFIBFloatField
      DisplayLabel = #1050#1086#1083'-'#1074#1086
      FieldName = 'GIVENCOUNT'
    end
    object dsDetailGIVENDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072
      FieldName = 'GIVENDATE'
    end
    object dsDetailPERIOD_END: TFIBDateField
      FieldName = 'PERIOD_END'
      Visible = False
    end
    object dsDetailCNAME: TFIBStringField
      DisplayLabel = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100
      FieldName = 'CNAME'
      Size = 92
      EmptyStrToNull = True
    end
    object dsDetailEXVAL: TFIBBCDField
      DisplayLabel = #1044#1086#1083#1103' '#1085#1072#1095#1080#1089#1083#1077#1085#1080#1081
      FieldName = 'EXVAL'
      Size = 2
      RoundByScale = True
    end
  end
  object dscDetail: TDataSource [12]
    DataSet = dsDetail
    Left = 108
    Top = 508
  end
  object dsTypes: TpFIBDataSet [13]
    SelectSQL.Strings = (
      'SELECT'
      '    CODE,'
      '    PAY_NAME'
      'FROM'
      '    PAY_TYPES '
      'order by 2')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 588
    Top = 88
    object dsTypesCODE: TFIBIntegerField
      FieldName = 'CODE'
    end
    object dsTypesPAY_NAME: TFIBStringField
      FieldName = 'PAY_NAME'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object dscTypes: TDataSource [14]
    DataSet = dsTypes
    Left = 620
    Top = 88
  end
  object dsTraits: TpFIBDataSet [15]
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    PAY_TYPE_TRAITS '
      'order by 2')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 590
    Top = 116
    object dsTraitsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTraitsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscTraits: TDataSource [16]
    DataSet = dsTraits
    Left = 622
    Top = 116
  end
  object dsGroups: TpFIBDataSet [17]
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    SERVICES '
      'WHERE GROUP_ID = 0'
      'order by 2')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 590
    Top = 144
    object dsGroupsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsGroupsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object dscGroups: TDataSource [18]
    DataSet = dsGroups
    Left = 622
    Top = 144
  end
end
